﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace MvcApplication.Service.CommonForm
{
    public static class BizService
    {
        public static Dictionary<Type, Type> GetAllContacts()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var allTypes = assembly.GetTypes();
            var contractTypes = new Dictionary<Type, Type>();
            foreach (var type in allTypes)
            {
                var interfaces = type.GetInterfaces();
                foreach (var i in interfaces)
                {
                    if (i.FullName.StartsWith("MvcApplication"))
                    {
                        contractTypes.Add(type, i);
                    }
                }
            }
            return contractTypes;
        }
    }
}
